<template>
  <MainLayout>
    <router-view></router-view>
    <el-card>
    <h3>日志管理</h3>
    <el-table :data="logs" style="width: 100%">
      <el-table-column prop="date" label="日期" width="150" />
      <el-table-column prop="level" label="级别" width="100">
        <template #default="scope">
          <el-tag :type="scope.row.level === 'error' ? 'danger' : 'info'">
            {{ scope.row.level }}
          </el-tag>
        </template>
      </el-table-column>
      <el-table-column prop="message" label="消息" />
    </el-table>
  </el-card>
  </MainLayout>

</template>

<script>
import MainLayout from '@/layouts/MainLayout.vue'
export default {
  components: { MainLayout }, // 确保 MainLayout 被正确引入
  data() {
    return {
      logs: [
        { date: '2023-10-01', level: 'info', message: '系统启动成功' },
        { date: '2023-10-02', level: 'error', message: '数据库连接失败' }
      ]
    };
  }
};
</script>

<style scoped>
.el-card {
  margin-bottom: 20px;
}
</style>